package com.itheima;

import com.itheima.controller.AccountController;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSpring {
    public static void main(String[] args) {
        // 获取容器对象
        ClassPathXmlApplicationContext context
                = new ClassPathXmlApplicationContext("spring.xml");
        // 如果非常确定一个类型就一个对象，就直接用类型获取
        AccountController accountController1 = context.getBean(AccountController.class);
        accountController1.save();
        System.out.println(accountController1.hashCode());
        AccountController accountController2 = context.getBean(AccountController.class);
        accountController2.save();
        System.out.println(accountController2.hashCode());
    }
}
